﻿/*
 * Created by SharpDevelop.
 * User: IEscarro
 * Date: 8/25/2009
 * Time: 10:02 AM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using Miming.Model.Dao;
using System.Collections.Generic;

namespace Miming.Model
{
	/// <summary>
	/// Description of SessionFacade.
	/// </summary>
	public class SessionFacade
	{
		public SessionFacade()
		{
		}
		
		public static void SaveOrUpdateModule(Module m)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateModuleDao().SaveOrUpdate(m);
		}
		
		public static void SaveOrUpdateShippingMethod(ShippingMethod m)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateShippingMethodDao().SaveOrUpdate(m);
		}
		
		public static void SaveOrUpdateOtherName(OtherName o)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateOtherNameDao().SaveOrUpdate(o);
		}
		
		public static void SaveOrUpdateVehicle(Vehicle v)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateVehicleDao().SaveOrUpdate(v);
		}
		
		public static void SaveOrUpdateToDo(ToDo t)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateToDoDao().SaveOrUpdate(t);
		}
		
		public static void SaveOrUpdateEmployee(Employee e)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateEmployeeDao().SaveOrUpdate(e);
		}
		
		public static void SaveOrUpdateSalesOrder(SalesOrder o)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateSalesOrderDao().SaveOrUpdate(o);
		}
		
		public static void SaveOrUpdateWorkersCompensation(WorkersCompensation w)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateWorkersCompensationDao().SaveOrUpdate(w);
		}
		
		public static void SaveOrUpdateAccount(Account a)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateAccountDao().SaveOrUpdate(a);
		}
		
		public static void SaveOrUpdateBill(Bill b)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateBillDao().SaveOrUpdate(b);
		}
		
		public static void SaveOrUpdateCustomerMessage(CustomerMessage c)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCustomerMessageDao().SaveOrUpdate(c);
		}
		
		public static void SaveOrUpdateJobType(JobType t)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateJobTypeDao().SaveOrUpdate(t);
		}
		
		public static void SaveOrUpdateCustomer(Customer c)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCustomerDao().SaveOrUpdate(c);
		}
		
		public static void SaveOrUpdateCustomerType(CustomerType t)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCustomerTypeDao().SaveOrUpdate(t);
		}
		
		public static void SaveOrUpdatePriceLevel(PriceLevel l)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreatePriceLevelDao().SaveOrUpdate(l);
		}
		
		public static void SaveOrUpdatePaymentMethod(PaymentMethod m)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreatePaymentMethodDao().SaveOrUpdate(m);
		}
		
		public static void SaveOrUpdateClass(Class c)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateClassDao().SaveOrUpdate(c);
		}
		
		public static void SaveOrUpdateTerms(Terms t)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateTermsDao().SaveOrUpdate(t);
		}
		
		public static void SaveOrUpdateVendorType(VendorType t)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateVendorTypeDao().SaveOrUpdate(t);
		}
		
		public static void SaveOrUpdateBillingRateLevel(BillingRateLevel l)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateBillingRateLevelDao().SaveOrUpdate(l);
		}
		
		public static void SaveOrUpdateSalesTaxCode(SalesTaxCode t)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateSalesTaxCodeDao().SaveOrUpdate(t);
		}
		
		public static void SaveOrUpdateUnitOfMeasure(UnitOfMeasure u)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateUnitOfMeasureDao().SaveOrUpdate(u);
		}
		
		public static void SaveOrUpdateItem(Item i)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateItemDao().SaveOrUpdate(i);
		}
		
		public static void SaveOrUpdateItemReceipt(ItemReceipt r)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateItemReceiptDao().SaveOrUpdate(r);
		}
		
		public static void SaveOrUpdateVendor(Vendor v)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateVendorDao().SaveOrUpdate(v);
		}
		
		public static void SaveOrUpdateCompany(Company c)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCompanyDao().SaveOrUpdate(c);
		}
		
		public static void SaveOrUpdatePurchaseOrder(PurchaseOrder o)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreatePurchaseOrderDao().SaveOrUpdate(o);
		}
		
		public static void SaveOrUpdateUser(User u)
		{
			DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateUserDao().SaveOrUpdate(u);
		}
		
		public static BillingRateLevel ReadBillingRateLevelByPk(int id)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateBillingRateLevelDao().ReadByPk(id);
		}
		
		public static Class ReadClassByPk(int id)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateClassDao().ReadByPk(id);
		}
		
		public static Terms ReadTermsByPk(int id)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateTermsDao().ReadByPk(id);
		}
		
		public static SalesTaxCode ReadSalesTaxCodeByPk(int id)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateSalesTaxCodeDao().ReadByPk(id);
		}
		
		public static Item ReadItemByPk(int id)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateItemDao().ReadByPk(id);
		}
		
		public static Customer ReadCustomerByPk(int id)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCustomerDao().ReadByPk(id);
		}
		
		public static User ReadUserByNameAndPassword(string name, string password)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateUserDao().ReadByNameAndPassword(name, password);
		}
		
		public static Company ReadCompanyByPk(int id)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCompanyDao().ReadByPk(id);
		}
		
		public static Module ReadModuleByCode(string code)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateModuleDao().ReadByCode(code);
		}
		
		public static IList<WorkersCompensation> FindAllWorkersCompensations()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateWorkersCompensationDao().FindAll();
		}
		
		public static IList<Module> FindAllModules()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateModuleDao().FindAll();
		}
		
		public static IList<PurchaseOrder> FindAllPurchaseOrders()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreatePurchaseOrderDao().FindAll();
		}
		
		public static IList<BillingRateLevel> FindAllBillingRateLevels()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateBillingRateLevelDao().FindAll();
		}
		
		public static IList<OtherName> FindAllOtherNames()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateOtherNameDao().FindAll();
		}
		
		public static IList<CustomerMessage> FindAllCustomerMessages()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCustomerMessageDao().FindAll();
		}
		
		public static IList<Vehicle> FindAllVehicles()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateVehicleDao().FindAll();
		}
		
		public static IList<PriceLevel> FindAllPriceLevels()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreatePriceLevelDao().FindAll();
		}
		
		public static IList<Terms> FindAllTerms()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateTermsDao().FindAll();
		}
		
		public static IList<Vendor> FindAllVendors()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateVendorDao().FindAll();
		}
		
		public static IList<Item> FindAllItems()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateItemDao().FindAll();
		}
		
		public static IList<ToDo> FindAllToDos()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateToDoDao().FindAll();
		}
		
		public static IList<Item> FindItemsByCode(string code)
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateItemDao().FindByCode(code);
		}
		
		public static IList<Customer> FindAllCustomers()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCustomerDao().FindAll();
		}
		
		public static IList<ShippingMethod> FindAllShippingMethods()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateShippingMethodDao().FindAll();
		}
		
		public static IList<PaymentMethod> FindAllPaymentMethods()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreatePaymentMethodDao().FindAll();
		}
		
		public static IList<Class> FindAllClasses()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateClassDao().FindAll();
		}
		
		public static IList<CustomerType> FindAllCustomerTypes()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateCustomerTypeDao().FindAll();
		}
		
		public static IList<Employee> FindAllEmployees()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateEmployeeDao().FindAll();
		}
		
		public static IList<User> FindAllUsers()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateUserDao().FindAll();
		}
		
		public static IList<JobType> FindAllJobTypes()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateJobTypeDao().FindAll();
		}
		
		public static IList<Account> FindAllAccounts()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateAccountDao().FindAll();
		}
		
		public static IList<SalesTaxCode> FindAllSalesTaxCodes()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateSalesTaxCodeDao().FindAll();
		}
		
		public static IList<VendorType> FindAllVendorTypes()
		{
			return DaoFactory.GetDaoFactory(DaoFactory.NHIBERNATE).CreateVendorTypeDao().FindAll();
		}
	}
}
